package com.liudachu.interview.bishi;


import java.util.Scanner;

/**
 * 质数
 */
public class Textzhishu {
    public static void main(String args[]){
        Scanner a = new Scanner(System.in);

        while(a.hasNext()){
            int m = a.nextInt();
            int n = a.nextInt();
            int x = m;
            int t;
            int count=0;
            for (x = m; x <= n; x++) {
                for (int i = 2; i <= x; i++) {
                    t = x % i;
                    if (t == 0) {
                        if(x==i){
                            count++;
                            //System.out.print(x+";");
                        }
                        else break;
                    }
                    else {
                        continue;
                    }
                }
            }
            System.out.println(count);
        }
    }
}
